//
//  AnimateButtonVC.swift
//  SwiftLearning
//
//  Created by 黄龙 on 2024/1/31.
//

import UIKit

class AnimateButtonVC: BasicNavibarVC {
    var loginButton:TQQLoginButton?
    
//    deinit{
//        if let btn = loginButton{
//            btn.destroy()
//        }
//    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.rightBar.title = ""
    }
    
    override func initView() {
        loginButton = TQQLoginButton(frame: CGRect(x: screen_W/2-140/2, y: 25, width: 140, height: 36),title:"微信登录")
        if let btn = loginButton{
            workView.addSubview(btn)
            btn.setTitle("微信注册", for: .normal)
            btn.setTitleColor(.label, for: .normal)
            btn.titleLabel?.font = .systemFont(ofSize: 15)
            let image = UIImage(named: "logo_wx_white.png")
            btn.setImage(image, for: .normal)
            btn.layoutButton(.imageLeft, space: 6.0)
            
            btn.addActionWithBlock { sender in
                print("tap.loginbutton")
                if let btn = sender as? TQQLoginButton{
                    btn.pressButton()
                }
            }
            btn.backgroundColor = .systemGreen
            btn.layer.cornerRadius = 5.0
        }
        
    }

}
